/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package my.cbr.database.model.measurement;

import my.cbr.database.model.ApproximationNumber;
import java.util.ArrayList;
import java.util.List;
import jcolibri.cbrcore.Attribute;
import jcolibri.cbrcore.CaseComponent;
import my.cbr.casedescriptions.CaseDescription;

/**
 *
 * @author Geir Ole
 */
public class MeasurementType<E extends MeasurementInstance> implements CaseComponent {
    private Integer ID;
    private String trend;
    private E currentInstance;
    private List<E> pastInstances = new ArrayList<E>();
    private ApproximationNumber approximation;// = new ApproximationNumber();
    private List<CaseDescription> descriptions = new ArrayList<CaseDescription>();

    public MeasurementType() {
    }

    public MeasurementType(E currentInstance) {
        this.currentInstance = currentInstance;
    }

    
    public List<CaseDescription> getDescriptions() {
        return descriptions;
    }

    public void setDescriptions(List<CaseDescription> descriptions) {
        this.descriptions = descriptions;
    }
    
    public void addDescription(CaseDescription caseDescription) {
        this.descriptions.add(caseDescription);
    }

    /**
     * Get the value of ID
     *
     * @return the value of ID
     */
    public Integer getID() {
        return ID;
    }

    /**
     * Set the value of ID
     *
     * @param ID new value of ID
     */
    public void setID(Integer ID) {
        this.ID = ID;
    }

    /**
     * Get the value of approximation
     *
     * @return the value of approximation
     */
    public ApproximationNumber getApproximation() {
        return approximation;
    }

    /**
     * Set the value of approximation
     *
     * @param approximation new value of approximation
     */
    public void setApproximation(ApproximationNumber approximation) {
        this.approximation = approximation;
    }

    /**
     * Get the value of trend
     *
     * @return the value of trend
     */
    public String getTrend() {
        return trend;
    }

    /**
     * Set the value of trend
     *
     * @param trend new value of trend
     */
    public void setTrend(String trend) {
        this.trend = trend;
    }

    /**
     * Get the value of pastInstances
     *
     * @return the value of pastInstances
     */
    public List<E> getPastInstances() {
        return pastInstances;
    }

    /**
     * Set the value of pastInstances
     *
     * @param pastInstances new value of pastInstances
     */
    public void setPastInstances(List<E> pastInstances) {
        this.pastInstances = pastInstances;
    }

    /**
     * Get the value of currentInstance
     *
     * @return the value of currentInstance
     */
    public E getCurrentInstance() {
        return currentInstance;
    }

    /**
     * Set the value of currentInstance
     *
     * @param currentInstance new value of currentInstance
     */
    public void setCurrentInstance(E currentInstance) {
        this.currentInstance = currentInstance;
    }

    @Override
    public String toString() {
        return "MeasurementType{" + "trend=" + trend + ", currentInstance=" + currentInstance + ", pastInstances=" + pastInstances + '}';
    }
    
    
    public Attribute getIdAttribute() {
        return new Attribute("ID", this.getClass());
    }
}
